Skip to main content

Android InApp SDK Integration

Download Android SDK Integration DEMO Android SDK DEMO

Currently, the SDK supports only the local AAR dependency mode

Android InApp SDK Integration to a payment originating form Merchant’s mobile app.

Quick Steps:

1. Download the EthiopiaPaySdkModule to the project app

EthiopiaPaySdkModule-uat-release.aar

2. Create a new libs folder in the project app (or other submodules), and copy the EthiopiaPaySdkModule-uat-release.aar file to the folder:

B2B Integration Process

3. Add the following dependency to the build.gradle file:

dependencies {
implementation files(' libs/EthiopiaPaySdkModule-uat-release.aar')
}

4. The third-party app places an order on the SuperApp server, obtains the order information, and constructs the receiveCode field.

B2B Integration Process

B2B Integration Process

receiveCode={TELEBIRR}${BUYGOOD}${shortCode}${amount}${prepay_id}%{time}
receiveCode sample:TELEBIRR$BUYGOODS$500358$50.00$202307261139071684121154928791554$30

5. Then invoke the SDK API to start the payment.

final PayInfo payInfo = new PayInfo.Builder()
.setAppId(orderInfo.appId)
.setShortCode(orderInfo.shortCode)
.setReceiveCode(orderInfo.receiveCode)
.build();
PaymentManager.getInstance().pay(this, payInfo);

6. Listen to the payment callback.

PaymentManager.getInstance().setPayCallback(new PayCallback() {

@Override
public void onPayCallback(int code, String errMsg) {
Log.d(TAG, "onPayCallback: code "+ code +" errMsg " + errMsg);
Toast.makeText(App.this, code + errMsg, Toast.LENGTH_SHORT).show();
}
});

7. Error Code Description

Error Code Description

Error CodeDescription
1Unknown error.
2Parameter error.
3Cancellation of payment
10The Payment is not installed.
11The current version of the Payment does not support this function.

8. Add Obfuscation Rule

keep class com.huawei.ethiopia.pay.sdk.api.core.* {;}

Check the demo for detailed implementation of the integration EthiopiaSDK-develop_demo